package org.znxs.znxsojquestion.controller.inner;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.znxs.model.model.entity.Question;
import org.znxs.model.model.entity.QuestionSubmit;
import org.znxs.znxsojquestion.services.QuestionService;
import org.znxs.znxsojquestion.services.QuestionSubmitService;
import org.znxs.znxsojservice.services.QuestionFeignClient;

import javax.annotation.Resource;

@RestController
@RequestMapping("/inner")
public class QuestionFeignController implements QuestionFeignClient {


    @Resource
    private QuestionService questionService;
    @Resource
    private QuestionSubmitService questionSubmitService;

    @Override
    public QuestionSubmit getSubmitById(long questionSubmitId) {
        return questionSubmitService.getById(questionSubmitId);
    }

    @Override
    public Question getById(long questionId) {
        return questionService.getById(questionId);
    }

    @Override
    public boolean updateById(QuestionSubmit updateQuestionSubmit) {
        return questionSubmitService.updateById(updateQuestionSubmit);
    }
}
